/* 
 * ------------------------------------------------------------------------
 * This is the android pixel map class that implements basic game interface 
 * pixel map.  
 * 2011, by Wu Mu Xian
 * --------------------------------------------------------------------
*/

package mygame.myandroidgameframework;

import android.graphics.Bitmap;

import mygame.basicgameframework.Pixelmap;
import mygame.basicgameframework.Graphics.PixmapFormat;

public class MyAndroidPixelmap implements Pixelmap {
	
	Bitmap bitmap; // the bitmap
	PixmapFormat format; // the pixel map format
	
	// the constructor
	public MyAndroidPixelmap(Bitmap bitmap, PixmapFormat format) { 
        this.bitmap = bitmap;  
        this.format = format; 
    }

	// get the width of the bitmap
	public int getWidth() {
		return bitmap.getWidth();
	}

	// get the height of the bitmap
	public int getHeight() {
		return bitmap.getHeight();
	}

	// get the format of the pixel map
	public PixmapFormat getFormat() {
		return format;
	}

	// dispose the bitmap
	public void dispose() {
		bitmap.recycle();
	}
}
